package br.ufrj.dcc.comp2.musica.vista;

import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JPanel;

import br.ufrj.dcc.comp2.musica.listeners.ListenerLogin;

public class PainelLoginCentral extends JPanel {
	private PainelLoginCampos painelCampos = new PainelLoginCampos();
	private JPanel painelBotao = new JPanel();
	private JButton botaoEntrar = new JButton("Entrar");
	private GridBagConstraints gBagCons;
	private ListenerLogin ouvinteLogin;
	private FrameLogin janelaLogin;

	public PainelLoginCentral(FrameLogin janelaLogin) {

		super(new GridBagLayout());
		gBagCons = new GridBagConstraints();
		this.janelaLogin = janelaLogin;

		ouvinteLogin = new ListenerLogin(this);

		botaoEntrar.addActionListener(ouvinteLogin);

		painelBotao.add(botaoEntrar, BorderLayout.CENTER);

		add(painelCampos, gBagCons);

		gBagCons.gridy = 1;
		add(painelBotao, gBagCons);
	}

	public PainelLoginCampos getPainelCampos() {
		return painelCampos;
	}

	public FrameLogin getJanelaLogin() {
		return janelaLogin;
	}

}
